package com.rowger.player.util

import android.content.Intent
import android.os.Build
import android.support.annotation.RequiresApi
import android.support.v7.widget.Toolbar
import com.rowger.player.R
import com.rowger.player.ui.activity.SettingActivity


/**
 * Created by Administrator on 2018/5/9.
 *
 */
interface ToolBarManager {
    val toolbar: Toolbar


    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
    fun initMainToolBar(){
      toolbar.setTitle("Rowger影音")
      toolbar.inflateMenu(R.menu.main)
      toolbar.setOnMenuItemClickListener {
           toolbar.context.startActivity(Intent(toolbar.context, SettingActivity::class.java))
           true
      }
    }

    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
    fun initSettingToolbar(){

       toolbar.setTitle("设置")
    }
}